package com.weasing.res.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.weasing.res.dao.IWxRoleDao;
import com.weasing.res.dao.base.impl.BaseDaoImpl;
import com.weasing.res.domain.WxRole;

@Repository
public class WxRoleDaoImpl extends BaseDaoImpl<WxRole> implements IWxRoleDao {


	/**
	 * 根据用户名字查用户
	 * 
	 * @param 用户名
	 * 
	 */
	public WxRole findUserByUsername(String username) {
		String hql = "FROM WxRole u WHERE u.rolename = ?";
		List<WxRole> list = (List<WxRole>) this.getHibernateTemplate().find(
				hql,
				username);
		if (list != null && list.size() > 0) {
			return list.get(0);
		}
		return null;
	}

}
